/**
 * 
 */
package com.zho.common.consumer.email;

import java.util.Collection;
import java.util.List;

import com.zho.common.consumer.queue.DefaultQueueInDataService;
import com.zho.util.Logit;

import org.springframework.mail.javamail.MimeMessagePreparator;

public class EmailInDataService extends DefaultQueueInDataService<MimeMessagePreparator> implements IEmailServiceHelper {
    private static final Logit logger = Logit.getInstance(EmailInDataService.class);

    /*
     * (non-Javadoc)
     * 
     * @see vn.com.vistar.commons.consumer.IInDataService#callbackError(java.util.List,
     *      java.lang.Exception)
     */
    public void callbackError(List<MimeMessagePreparator> data, Exception e) {
        logger.error("callbackError()::", e);
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.springframework.beans.factory.DisposableBean#destroy()
     */
    public void destroy() throws Exception {
        /*
         * if(!msg_queue.isEmpty()) { while(msg_queue.poll() != null); }
         */
    }

    /**
     * 
     */
    public void addEmailMsg(MimeMessagePreparator msg) {
        this.add(msg);
    }

    /**
     * 
     */
    public void addEmailMsg(Collection<MimeMessagePreparator> msgs) {
        this.add(msgs);
    }
}
